package com.topvision.service.impl.zwan;

import com.topvision.annotation.DataSource;
import com.topvision.db.DataSourceConstants;
import com.topvision.util.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;


import com.topvision.mapper.zwan.CompanyinfoMapper;
import com.topvision.model.zwan.Companyinfo;
import com.topvision.service.zwan.CompanyinfoService;

@Service("companyinfoService")
@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
public class CompanyinfoServiceImpl implements CompanyinfoService {
	@Autowired
	private CompanyinfoMapper companyinfoMapper;

	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public Companyinfo queryObject(BigDecimal companyid){
		return companyinfoMapper.queryObject(companyid);
	}
	
	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public List<Companyinfo> queryList(Map<String, Object> map){
		return companyinfoMapper.queryList(map);
	}
	
	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public int queryTotal(Map<String, Object> map){
		return companyinfoMapper.queryTotal(map);
	}

	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public void save(Companyinfo companyinfo){
		companyinfoMapper.save(companyinfo);
	}

	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public void update(Companyinfo companyinfo){
		companyinfoMapper.update(companyinfo);
	}
	
	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public void delete(BigDecimal companyid){
		companyinfoMapper.delete(companyid);
	}
	
	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public void deleteBatch(BigDecimal[] companyids){
		companyinfoMapper.deleteBatch(companyids);
	}

	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public int addCompany(Map<String, Object> params) {
		return companyinfoMapper.addCompany(params);
	}

	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public List<Companyinfo> queryByParam(Query query) {
		return companyinfoMapper.queryByParam(query);
	}

	@Override
	@DataSource(DataSourceConstants.ORACLE_PORTAL_SLAVE)
	public List<Map<String, Object>> allList() {
		return companyinfoMapper.allList();
	}

}
